import Vue from 'vue'
import VueRouter from 'vue-router'
import HomePanel from '../views/HomePanel.vue'

Vue.use(VueRouter)

const routes = [
  {
    meta: {
      keeplive:false,
      header: true,
      footer: true,
      middle: true,
      title:'医院概况 - 四川大学华西医院 - 四川大学华西医院',
    },
    path: '/hxcy',
    name: 'HXCY',
    component: () => import('../views/HXCY.vue'),
  },
  {
    meta: {
      keeplive:false,
      header: true,
      footer: true,
      middle: true,
      title:'医院概况 - 四川大学华西医院 - 四川大学华西医院-医联体',
    },
    path: '/hxylt',
    name: 'HXYLT',
    component: () => import('../views/HXYLT.vue'),
  },

  {
    meta: {
      keeplive:false,
      header: true,
      footer: true,
      middle: true,
      title:'医院概况 - 四川大学华西医院 - 四川大学华西医院',
    },
    path: '/success',
    name: 'success',
    component: () => import('../testing/Success.vue'),
  },
  {
    meta: {
      keeplive:true,
      header: true,
      footer: true,
      middle: true,
      title:'医院概况 - 四川大学华西医院 - 四川大学华西医院',
    },
    path: '/news',
    name: 'NEWS',
    component: () => import('../views/News.vue'),
  },
  
  {
    meta: {
      keeplive:true,
      header: true,
      footer: true,
      middle: true,
      title:'医院概况 - 四川大学华西医院 - 四川大学华西医院',
    },
    path: '/hzfw',
    name: 'HZFW',
    component: () => import('../views/Service.vue'),
  },
  {
    meta: {
      keeplive:true,
      header: true,
      footer: true,
      middle: true,
      title:'医院概况 - 四川大学华西医院 - 四川大学华西医院',
    },
    path: '/hxxy',
    name: 'HXXY',
    component: () => import('../views/Hxxy.vue'),
  },
  {
    meta: {
      keeplive:false,
      header: true,
      footer: true,
      middle: true,
      title:'医院概况 - 四川大学华西医院 - 四川大学华西医院',
    },
    path: '/hsyy',
    name: 'hsyy',
    component: () => import('../testing/HSYY.vue'),
  },
  {
    path: '/full',
    name: 'full',
    component: () => import('../testing/Fullpage.vue'),
  },
  {
    meta: {
      keeplive:true,
      header: true,
      footer: true,
      middle: true,
      title:'医院概况 - 四川大学华西医院 - 四川大学华西医院',
    },
    path: '/yygk',
    name: 'Yygk',
    component: () => import('../views/Yygk.vue'),
  },
  {
    meta: {
      keeplive:true,
      header: true,
      footer: true,
      middle: true,
      title:'公众版 - 四川大学华西医院 - 四川大学华西医院',
    },
    path: '/index',
    name: 'Index',
    component: () => import('../views/Index.vue'),
  },
  {
    //自定义路由meta属性 用于判断公共组件是否显示
    meta: {
      keeplive:true,
      header: false,
      footer: false,
      middle: false,
      title:'四川大学华西医院 - 四川大学华西医院',
    },

    path: '/',
    name: 'HomePanel',
    component: HomePanel
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})
router.beforeEach((to,from,next)=>{
  document.title = to.meta.title
  next()
})

export default router